package javachongkao.编程基础.分解质因数;

import java.util.Scanner;
//7-72 分解质因数
//求出区间[a,b]中所有整数的质因数分解。
//
//输入格式:
//输入两个整数a，b。数据规模和约定　　2<=a<=b<=10000
//
//输出格式:
//每行输出一个数的分解，形如k=a1a2a3...(a1<=a2<=a3...，k也是从小到大的)(具体可看样例)
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        if (a < 2 || b > 10000 || a > b) {
            System.out.println("输入范围应在2到10000之间，且a ≤ b");
            return;
        }
        for (int k = a; k <= b; k++) {
            System.out.print(k + "=");
            int temp = k;
            boolean firstFactor = true;
            for (int i = 2; i <= temp; i++) {
                while (temp % i == 0) {
                    if (!firstFactor) {
                        System.out.print("*");
                    }
                    System.out.print(i);
                    temp /= i;
                    firstFactor = false;
                }
            }
            System.out.println();
        }
        scanner.close();
    }
}
